﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DesktopGarden.Classes;

    [Serializable]
    public class Garden
    {
        /// <summary>
        /// Name of the Garden.
        /// </summary>
        public string GardenName { get; set; }

        /// <summary>
        /// All the flowers that are currently planted in the garden.
        /// </summary>
        public List<FlowerInstance> Flowers { get; set; }

        /// <summary>
        /// The Date the user created the garden.
        /// </summary>
        public DateTime DateCreated { get; set; }

        /// <summary>
        /// The Location that the garden file is saved under.
        /// </summary>
        public string SaveLocation { get; set; }


        public int Columns { get; set; }

        public int Rows { get; set; }

        public Garden()
        {
            Flowers = new List<FlowerInstance>();
        }

        public void Save()
        {
            this.Save(SaveLocation);
        }

        public static Garden Load(string location)
        {
            return Helper.Load<Garden>(location);
        }

        internal void DeleteFlower(FlowerInstance fl)
        {
            Flowers.Remove(fl);
            Save();
        }
    }

